#include "AddSheetCommand.h"
#include "FrakOutController.h"

AddSheetCommand::AddSheetCommand(const QString& text,
                                 FrakOutController& controller,
                                 const FrakOutDataItem& sheet,
                                 int sheetIndex) :
QUndoCommand(text), m_controller(controller), m_sheet(sheet), m_sheetIndex(sheetIndex)
{
}

void AddSheetCommand::redo()
{
    m_controller.addSheet(m_sheetIndex, m_sheet);
}

void AddSheetCommand::undo()
{
    m_controller.deleteSheet(m_sheetIndex);
}
